package com.ovopark.organize.server.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate;
import com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplateSection;

import java.util.List;

/**
 * @Description: 加盟商立项模板
 * @Author:zll
 * @Date:
 */
public interface FranchiseesApprovalTemplateService {

    /**
     * @description: 创建模板
     * @param: [vo]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate
     * @author wxb
     * @date: 2024/4/12 10:33
     */
    FranchiseesApprovalTemplate saveTemplate(FranchiseesApprovalTemplate template);

    /** 
     * @description: 新增
     * @param: [template]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate
     * @author wxb
     * @date: 2024/6/5 11:04
     */ 
    FranchiseesApprovalTemplate add(FranchiseesApprovalTemplate template);

    /** 
     * @description: 编辑
     * @param: [template]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate
     * @author wxb
     * @date: 2024/6/5 11:04
     */ 
    FranchiseesApprovalTemplate update(FranchiseesApprovalTemplate template);

    /**
     * @description: 关闭模板
     * @param: [groupId]
     * @return: void
     * @author wxb
     * @date: 2024/6/2 20:46
     */
    void closeTemplate(Integer groupId);

    /**
     * @description: 获取加盟商立项模板
     * @param: [vo]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate
     * @date: 2024/4/12 10:33
     */
    FranchiseesApprovalTemplate getTemplateById(Integer id, Integer groupId);

    /**
     * @description: 开启/关闭模版
     * @param: [id]
     * @return: boolean
     * @author wxb
     * @date: 2024/4/12 10:35
     */
    Boolean onOffTemplate(Integer id, Integer open, Integer groupId, Integer userId);

    /**
     * @description: 获取企业开启的模版
     * @param: [groupId]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate
     * @author wxb
     * @date: 2024/4/12 11:25
     */
    FranchiseesApprovalTemplate getDefaultTemplate(Integer groupId);

    /**
     * @description: 获取企业的模板 包含系统模版
     * @param: [groupId]
     * @return: List<FranchiseesApprovalTemplate>
     * @author wxb
     * @date: 2024/4/12 14:29
     */
    IPage<FranchiseesApprovalTemplate> getTemplateByGroupId(Integer pageSize, Integer pageNumber, Integer groupId, Integer open);

    /**
     * @description: 获取系统模板
     * @param: []
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate
     * @author wxb
     * @date: 2024/4/12 11:28
     */
    FranchiseesApprovalTemplate getSystemTemplate();

    /**
     * @description: 获取模板字段
     * @param: [templateId, groupId]
     * @return: com.ovopark.organize.server.model.vo.FranchiseesApprovalTemplateVo
     * @author wxb
     * @date: 2024/4/12 14:49
     */
    FranchiseesApprovalTemplate getTemplateFields(Integer templateId, Integer groupId, String version);

    /** 
     * @description: 获取模板配置
     * @param: [templateId, groupId]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplate
     * @author wxb
     * @date: 2024/6/1 22:44
     */ 
    FranchiseesApprovalTemplate getTemplateConf(Integer templateId, Integer groupId, String version);

    /**
     * @description: 保存模板字段
     * @param: [vo]
     * @return: void
     * @author wxb
     * @date: 2024/4/16 16:46
     */
    void saveTemplateFields(FranchiseesApprovalTemplate template);

    /**
     * @description: 保存模板配置
     * @param: [sectionList, userId]
     * @return: java.util.List<com.ovopark.organize.server.model.entity.FranchiseesApprovalTemplateSection>
     * @author wxb
     * @date: 2024/5/31 21:11
     */
    List<FranchiseesApprovalTemplateSection> saveTemplateFieldsConf(FranchiseesApprovalTemplate template, Integer userId);

    /**
     * @description: 获取模板字段值
     * @param: [templateId, groupId]
     * @return: FranchiseesApprovalTemplateFieldValueVo
     * @author wxb
     * @date: 2024/4/14 11:51
     */
    FranchiseesApprovalTemplate getTemplateFieldValue(Integer templateUserId, Integer groupId);

    /**
     * @description: 根据线索id获取模板
     * @param: [entityId, groupId]
     * @return: java.util.List<com.ovopark.organize.server.model.vo.FranchiseesApprovalVo>
     * @author wxb
     * @date: 2024/4/14 10:41
     */
    List<FranchiseesApprovalTemplate> batchGetTemplateList(List<Integer> templateIdList, Integer groupId);

    /** 
     * @description: 逻辑删除
     * @param: [id]
     * @return: void
     * @author wxb
     * @date: 2024/4/25 15:45
     */ 
    void deleteById(Integer id);

    /**
     * @description: 获取版本号
     * @param: [templateId]
     * @return: java.util.List<java.lang.String>
     * @author wxb
     * @date: 2024/6/1 13:08
     */
    List<String> getVersionListByTemplateId(Integer templateId, String version, Integer groupId);

    /** 
     * @description: 校验模板名称是否重复
     * @param: [enterpriseId, templateName]
     * @return: boolean
     * @author wxb
     * @date: 2024/6/6 15:52
     */ 
    List<FranchiseesApprovalTemplate> hasTemplateName(Integer groupId, String templateName);

}
